#include<stdio.h>
int main()
{
	int n,k,yes[10000],no[10000],i,n1=0,n2=0;
	double s1=0,s2=0;
	scanf("%d %d",&n,&k);
	for(i=1;i<=n;i++)
	if(i%k==0)
	{
		yes[i]=i;
		no[i]=0;
		n1++;
	}
	else
	{
		no[i]=i;
		yes[i]=0;
		n2++;
	}
	for(i=1;i<=n;i++)
	{
		s1=s1+yes[i];
		s2=s2+no[i];
	}
	printf("%.1f %.1f",s1/n1,s2/n2);
    return 0;
}

